<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <style>
      .star-six {
        margin: 50px auto;
        width: 0;
        height: 0;
        border: 50px solid transparent;
        border-bottom: 100px solid red;
        position: relative;
      }
      .star-six:after {
        width: 0;
        height: 0;
        border: 50px solid transparent;
        border-top: 100px solid red;
        position: absolute;
        content: "";
        top: 30px;
        left: -50px;
      }
      .eg {
        margin: 50px auto;
        width: 0;
        height: 0;
        border: 50px solid transparent;
        border-bottom: 100px solid yellow;
        position: relative;
      }
      .eg:after {
        width: 0;
        height: 0;
        border: 50px solid transparent;
        border-top: 100px solid red;
        position: absolute;
        content: "";
        top: 30px;
        left: -50px;
      }
    </style>
  </head>
  <body>
    <div class="star-six"></div>
    <p>eg: 六角形：正三角和倒三角形 定位和在一起(正方形的1/4比较扁，所以一般透明边框设置为有色边框的一半，效果更好)</p>
    <div class="eg"></div>
  </body>
</html>
